<%inherit file="../base.html" />
<%! from django.urls import reverse %>
<%def name="content()">
<%
    pre_page = '{}?page={}'.format(reverse('admin_manager'), page_num -1)
    next_page = '{}?page={}'.format(reverse('admin_manager'), page_num +1)
%>
<div><h1>你好</h1></div>
<div style="margin-left: 90%;margin-top: 20px;width: 100px;height: 30px">
% if page_num >1:
<a href="${pre_page}">上一页</a>
% endif
% if page_num < total:
<a href="${next_page}">下一页</a>
% endif
</div>

<table class="table" style="margin-top: 5px;border: 1px solid #8c8c8c">
    <thead>
    <tr>
        <th>用户名</th>
        <th>创建时间</th>
        <th>活跃状态</th>
        <th>管理状态</th>
    </tr>
    </thead>
    <tbody>
       % for user in users:
       <tr>
           <td>${user.username}</td>
           <td>${user.created_time}</td>
           <td>${user.status}</td>
           % if user.status:
           <td><a href="${reverse('user_update_status')}?status=off&name=${user.username}">封号</a></td>
           % else:
           <td><a href="${reverse('user_update_status')}?status=on&name=${user.username}">解封</a></td>
           % endif
       </tr>
       % endfor
    </tbody>
</table>
</%def>
